package com.qfjy.service.impl;

import com.qfjy.entity.po.User;
import com.qfjy.mapper.UserMapper;
import com.qfjy.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Author guoweixin
 * @Date 2022/9/30
 * @Version 1.0
 */
@Service
@Slf4j
public class UserServiceImpl implements UserService {


    @Autowired
    private UserMapper userMapper;

    /**
     * TODO 查询用户列表全部数据
     *
     * @return
     */
    @Override
    public List<User> selectList() {
        return userMapper.selectList();
    }

    /**
     * TODO  批量添加
     *
     * @param list
     */
    @Override
    public int insertBatch(List<User> list) {
        return userMapper.insertBatch(list);
    }

    /**
     * TODO 根据ID删除信息
     *
     * @param id
     * @return
     */
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return userMapper.deleteByPrimaryKey(id);
    }

    /**
     * TODO 批量删除 多个ID值
     *
     * @param ids
     */
    @Override
    public int deleteBatch(String[] ids) {
        return userMapper.deleteBatch(ids);
    }

    /**
     * TODO 状态修改
     *
     * @param status
     * @param id
     */
    @Override
    public int updateStatusById(int status, int id) {
        return userMapper.updateStatusById(status, id);
    }

    /**
     * TODO 查询所有的邮件列表数据
     */
    @Override
    public List<String> selectEmails() {
        return userMapper.selectEmails();
    }
}
